#define quickread
#ifdef quickread
#include <cstdio> 
template <typename T>
inline void read(T& x)
{
    int c=getchar(), f=1; x=0;
    while(c<'0'||'9'<c) {if(c=='-') f=-1; c=getchar();}
    while('0'<=c&&c<='9') 
        x=(x<<3)+(x<<1)+c-'0', c=getchar();
    x*=f;
}
template <typename T>
inline void quickwrite(T x)
{
    if(x<0) putchar('-'), x*=-1;
    if(x>=10) quickwrite(x/10);
    putchar(x%10+'0');
}
#else 
#include <iostream>
#endif
#include <cmath>
using namespace std;
#define DEBUG
const int N=210;
int n;
double dp[N][N][N], ans; //dp[i][j][k]:k秒后在(i,j)的概率
void init()
{
    read(n);
    dp[1][1][0]=1; //初始位置在(0, 0)
}

void solve()
{
    init();
    for(int k=1; k<=n; k++)
        for(int i=1; i<=n+1; i++)
            for(int j=1; j<=n+1; j++)
            {
                dp[i][j][k]=(dp[i-1][j][k-1]+dp[i][j-1][k-1]+dp[i-1][j-1][k-1])/3.0;
            }

    for(int i=1; i<=n+1; i++)
        for(int j=1; j<=n+1; j++)
            ans+=dp[i][j][n]*sqrt((i-1)*(i-1)+(j-1)*(j-1));
    printf("%.8lf\n", ans);
}

// #undef DEBUG
signed main()
{
    #ifdef DEBUG
        freopen("../in.txt", "r", stdin);
        freopen("../out.txt", "w", stdout);
    #endif
    #ifndef quickread
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    #endif

    int T=1; //scanf("%d", &T);
    while(T--) 
    {
        solve();
    }
    return 0;
}
